package com.hz.copyingsystem.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.common.utils.PageUtils;
import com.hz.common.utils.Query;

import com.hz.copyingsystem.dao.FixedInformationDicDao;
import com.hz.copyingsystem.entity.FixedInformationDicEntity;
import com.hz.copyingsystem.service.FixedInformationDicService;


@Service("fixedInformationDicService")
public class FixedInformationDicServiceImpl extends ServiceImpl<FixedInformationDicDao, FixedInformationDicEntity> implements FixedInformationDicService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<FixedInformationDicEntity> page = this.page(
                new Query<FixedInformationDicEntity>().getPage(params),
                new QueryWrapper<FixedInformationDicEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<FixedInformationDicEntity> queryByName(String name) {
        return this.baseMapper.selectList(
                new QueryWrapper<FixedInformationDicEntity>().eq("fixed_information_name", name)
                        .orderByAsc("iorder"));
    }

}